package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name   string `gorm:"type:varchar(10);comment:用户名"`
	Tel    string `gorm:"type:char(11);comment:电话号码"`
	Status int    `gorm:"type:int(1);comment:用户状态:0-正常，1-冻结"`
}

func (u *User) UpdateUser(UserId, status int) error {
	return DB.Model(&u).Where("id=?", UserId).Update("status", status).Error
}
